#ifndef _VN_ANIMATION_H_
#define _VN_ANIMATION_H_

#include "..\Generic\GameTime.h"
#include <string>

namespace vn
{
	class Animation
	{
	public:
		Animation(const std::string& p_id, int p_row, int p_frameRate, int p_startupFrame, int p_startFrame, int p_endFrame, int p_timesRepeat, bool p_repeat, bool p_reverse, bool p_reverseWhenRepeat);
		virtual ~Animation(void);

		void update(const GameTime&);

		const bool hasFrameChanged() const;
		const bool isDone() const			{ return m_done; }
		const int currentFrame() const		{ return m_currentFrame; }
		const int getRow() const			{ return m_row; }
		
		void setReverse(bool p_value)		{ m_reverse = p_value; }
		
		void reset();

		void setNextAnimation(const std::string& p_nextAnimation) { m_nextAnimation = p_nextAnimation; }
		const std::string& getNextAnimation() { return m_nextAnimation; }
		const std::string& getID() { return m_id; }

	private:
		std::string m_id;
		std::string m_nextAnimation;
		int m_startupFrame;		// the frame the animation will start at
		int m_startFrame;		// the frame the animation will loop from as opposed to starting
		int m_endFrame;
		int m_currentFrame;
		int m_previousFrame;
		int m_timesRepeat;
		int m_frameInc;
		int m_row;
		int m_frameRate;
		int m_oldTime;
		bool m_repeat;
		bool m_reverse;
		bool m_fixedRepeat;
		bool m_reverseWhenRepeat;
		bool m_pause;
		bool m_done;
	};
}

#endif // _VN_ANIMATION_H_